---
layout: post
title: Legendre transformation without Legendre transformation
date: '2013-08-12T08:42:00.002-07:00'
author: Alex Rogozhnikov
tags:
- Lagrange multipliers
- Theoretical physics
modified_time: '2013-09-05T09:44:56.778-07:00'
blogger_id: tag:blogger.com,1999:blog-307916792578626510.post-2889994042685023519
blogger_orig_url: http://brilliantlywrong.blogspot.com/2013/08/legendre-transformation-without.html
---

<div>If you heard something of theoretical mechanics, you definitely
    know that the most important transition in mechanics is one from <a
            href="http://en.wikipedia.org/wiki/Lagrangian_mechanics" >Lagrangian Mechanics</a>&nbsp;to <a
            href="http://en.wikipedia.org/wiki/Hamiltonian_mechanics" >Hamiltonian</a>. And its name is
    Legendre transform.<br/><br/>This transition is some kind of magic that to my mind is considered usually as some
    secret recipe. The recipe is<br/>
    <ul>
        <li>take the momenta: $p_i=\frac{\partial L}{\partial \dot{q_i}}$.</li>
        <li>prove that Hamilton equations hold: $$\frac{\partial H}{\partial q_j}=-\dot{p}_j,\qquad\frac{\partial
            H}{\partial p_j}=\dot{q}_j$$ where &nbsp;$$ H\left(q,\;p,\;t\right)=\sum_i\dot{q}_i p_i-L(q,\;\dot{q},\;t)
            $$
        </li>
    </ul>
    <div>And that is all the idea. But <i>why</i> should I take this Hamiltonian not some other function? <i>Why</i>
        should I consider Lagrangian derivatives as new variables instead of $q_i$ ? I didn't meet the answers in
        mechanics courses, though there is one simple intuitive justification. That's Pasha Gavrilenko who told me about
        it.
    </div>
    <div><br/></div>
    <div>What do we have initially? An action on some interval of time, this is the integral&nbsp;</div>
    <div>$$ S = \min_{q(\cdot)} \int_{t_1}^{t_2} L(q, \dot{q}, t) dt$$ which should be minimized (locally), that
        what Hamilton's principle states. (There are conditions on the endpoints which I will omit)&nbsp;</div>
    <div><br/></div>
    <div>Ok, the only trouble is $q$ and $\dot{q}$ aren't independent, otherwise the Lagrange equations would be much
        simpler: $ \frac{\partial L}{\partial q} = \frac{\partial L}{\partial \dot{q}} = 0 $<br/><br/>Let us try to
        replace $\dot{q}$ with $v$, assuming they are equal:
        $$ S = \min_{q(\cdot)} \int_{t_1}^{t_2} L(q, v, t)\bigg|_{v=\dot q} dt $$
        <br/><br/>
        Hmhmhm. Seems nothing changed. Now the trick. Let's add summand<br/>
        $$\delta(\dot{q},v) = \begin{cases} 0 &amp; \dot{q} = v \\ +\infty &amp; \text{otherwise} \end{cases}$$ and now we can minimize over
        all possible trajectories of $q$ and of $v$.
        $$ S = \min_{q(\cdot), v(\cdot)} \left[ \int_{t_1}^{t_2}
        L(q, v, t) dt + \delta[q,v] \right] $$
        <br/><br/>See? We have now $q$ and $v$ independent by the cost of
        additional summand. Now we can write $\delta$ in the following form (make sure you understand it):<br/>
        $$\delta[q,v] = \max_{p(\cdot)} \int_{t_1}^{t_2} p(t) (\dot{q}(t) - v(t)) dt $$
        <br/><br/>
        After substitution we have the problem on finding saddle point of the function:
        $$ S = \min_{q(\cdot), v(\cdot)} \max_{p(\cdot)} \int_{t_1}^{t_2} p(t) (\dot{q}(t) - v(t)) + L(q, v, t) dt $$
        Pay attention that all variables $p,q,v$ are independent now.
        The solution we need is trajectory $q(\cdot)$, but it has corresponding trajectories $v(\cdot)$ and $p(\cdot)$ which form a saddle point together with $q(\cdot)$.<br/><br/>
        As we know, at the saddle point all the partial derivatives are zero (assuming the function is differentiable).
        Calculating variational derivatives with respect to $p,v,q$ gives respectively
        $$ \begin{aligned}
            \dot{q} &= v \\
            p &= \frac{\partial L}{\partial \dot{q}} \\
            \dot{p} &= \frac{\partial L}{\partial q}
        \end{aligned}
        $$
        Note that energy function $H(q,v,t)$
        also appeared in a natural way as well as least action principle in Hamiltonian mechanics
        $$ \begin{aligned}
            p(t) (\dot{q}(t) - v(t)) + L(q, v, t) = p(t) \dot{q}(t) - \left[ p(t)v(t) - L(q,v,t) \right] = \\
            = \{\text{changing the variables} \} = p(t) \dot{q}(t) - H(p,q,t)
        \end{aligned} $$<br/>
        You may have noticed that the thing I did is just added <a href="http://en.wikipedia.org/wiki/Lagrange_multiplier" >Lagrange multiplier</a> ho make the condition $\dot{q} = v$ hold. <br/><br/>This way Legendre transformation looks
        more accessible to my mind.
    </div>
</div>